<template>
<layout-pm>
  <pm-home-todo v-if="tabKey === PmTabBarType.TODO" />
  <pm-home-project v-else-if="tabKey === PmTabBarType.PROJECT" />
  <pm-home-my v-else-if="tabKey === PmTabBarType.MY" />
</layout-pm>
</template>

<script setup lang="ts">
import LayoutPm from "@/layouts/pm.vue";
import PmHomeTodo from "@/pmPages/index/todo.vue";
import PmHomeMy from "@/pmPages/index/my.vue";
import PmHomeProject from "@/pmPages/index/project.vue";
import {storeToRefs} from "pinia";
import {usePmAppStore} from "@/stores/pm";
import {PmTabBarType} from "@/enum";

const { tabKey } = storeToRefs(usePmAppStore())

watch(() => tabKey.value, (val) => {
  if (val === PmTabBarType.HOME) {
    uni.navigateTo({ url: '/pages/index/index' })
  }
})
</script>

<style scoped lang="scss">

</style>
